﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ECRMS.Biz.Dom;
using ECRMS.Biz;
using ECRMS.Common;
using System.ServiceModel;
using System.ServiceModel.Web;

namespace ECRMS.Service
{
    [ServiceContract]
    public partial interface ICtReportService
    {
        [OperationContract]
        CtServiceResult<List<CtReport>> CtGetReoprts(Guid corpId);

        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped)]
        CtServiceResult<List<CtReport>> CtGetReoprtsByEmployeId(Guid corpId, Guid employeeId);

        [OperationContract]
        CtServiceResult<List<CtReport>> CtGetReoprtsNoContent(Guid corpId);

        [OperationContract]
        CtServiceResult CtUpdateReportNoContent(CtReport report);

        [OperationContract]
        CtServiceResult CtUpdateReports(List<CtReport> reports);

        [OperationContract]
        CtServiceResult CtUpdateReportSeq(List<CtReport> reports);

    }

    public partial class ECRService : ICtReportService
    {
        CtServiceResult<List<CtReport>> ICtReportService.CtGetReoprts(Guid corpId)
        {
            var logic = new CtReportLogic();
            return logic.GetAllReportByCorpId(corpId);
        }

        CtServiceResult<List<CtReport>> ICtReportService.CtGetReoprtsByEmployeId(Guid corpId, Guid employeeId)
        {
            var logic = new CtReportLogic();
            return logic.GetAllReportByCorpIdAndEmployeeId(corpId, employeeId);
        }

        CtServiceResult<List<CtReport>> ICtReportService.CtGetReoprtsNoContent(Guid corpId)
        {
            var logic = new CtReportLogic();
            return logic.GetAllReportNoContentByCorpId(corpId);
        }

        CtServiceResult ICtReportService.CtUpdateReportNoContent(CtReport report)
        {
            var logic = new CtReportLogic();
            return logic.UpdateReportNoContent(report);
        }

        CtServiceResult ICtReportService.CtUpdateReports(List<CtReport> reports)
        {
            var logic = new CtReportLogic();
            return logic.UpdateReport(reports);
        }

        CtServiceResult ICtReportService.CtUpdateReportSeq(List<CtReport> reports)
        {
            var logic = new CtReportLogic();
            return logic.UpdateReportSeq(reports);
        }

    }
}
